class Solution {
public:
    int vowelStrings(vector<string>& words, int left, int right) {
        unordered_map<char, int>mp;
        mp['a'] = mp['e'] = mp['i'] = mp['o'] = mp['u'] = 1;
        int ans = 0;
        for (int i = left; i <= right; i++) {
            int n = words[i].size();
            if (mp[words[i][n - 1]] && mp[words[i][0]])ans++;
        }
        return ans;
    }
};